import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopCartController } from '../../../controllers';
const uctoominishopCartRouter = new Router();
const minishopCartController = new uctooMinishopCartController();

uctoominishopCartRouter.post('/add', requireUser, minishopCartController.add);
uctoominishopCartRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_cart'), minishopCartController.edit);
uctoominishopCartRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_cart'), minishopCartController.delete);

//For getting minishopCart with permission control
uctoominishopCartRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_cart'), minishopCartController.getSingle);
uctoominishopCartRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_cart'), minishopCartController.getMany);
uctoominishopCartRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_cart'), minishopCartController.getMany);

//#endregion AutoCreateCode
export default uctoominishopCartRouter;
